<template>
  <div class="nav-menu">
    <div class="nav-txt">openHarmony</div>
    <div class="nav-content">
      <div class="nav-input">
        <el-input
          size="mini"
          placeholder="请输入内容"
          prefix-icon="el-icon-search"
          v-model="inputTxt"
        >
        </el-input>
      </div>
      <div>
        <el-menu
          :default-active="activeIndex"
          class="el-menu-demo"
          mode="horizontal"
          @select="handleSelect"
        >
          <el-menu-item
            index="/mainPlay"
            :route="{ path: '/mainPlay', query: { name: 10 } }"
            >首页</el-menu-item
          >
          <el-menu-item index="/detail">下载</el-menu-item>
          <el-submenu index="3">
            <template slot="title" class="main-txt">指南</template>
            <el-menu-item index="3-1">选项1</el-menu-item>
            <el-menu-item index="3-2">选项2</el-menu-item>
            <el-menu-item index="3-3">选项3</el-menu-item>
          </el-submenu>
          <el-submenu index="4">
            <template slot="title">用户社区</template>
            <el-menu-item index="4-1">选项1</el-menu-item>
            <el-menu-item index="4-2">选项2</el-menu-item>
            <el-menu-item index="4-3">选项3</el-menu-item>
          </el-submenu>
          <el-menu-item index="5">成员单位</el-menu-item>
          <el-menu-item index="6">SIG</el-menu-item>
          <el-submenu index="7">
            <template slot="title">服务</template>
            <el-menu-item index="7-1">选项1</el-menu-item>
            <el-menu-item index="7-2">选项2</el-menu-item>
            <el-menu-item index="7-3">选项3</el-menu-item>
          </el-submenu>
          <el-submenu index="8">
            <template slot="title">活动</template>
            <el-menu-item index="8-1">选项1</el-menu-item>
            <el-menu-item index="8-2">选项2</el-menu-item>
            <el-menu-item index="8-3">选项3</el-menu-item>
          </el-submenu>
          <el-menu-item index="9">支持设备</el-menu-item>
          <el-submenu index="10">
            <template slot="title">关于</template>
            <el-menu-item index="10-1">选项1</el-menu-item>
            <el-menu-item index="10-2">选项2</el-menu-item>
            <el-menu-item index="10-3">选项3</el-menu-item>
          </el-submenu>
          <el-submenu index="11">
            <template slot="title">外部链接</template>
            <el-menu-item index="11-1">选项1</el-menu-item>
            <el-menu-item index="11-2">选项2</el-menu-item>
            <el-menu-item index="11-3">选项3</el-menu-item>
          </el-submenu>
          <el-menu-item index="12">旧版官网</el-menu-item>
        </el-menu>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  //import引入的组件需要注入到对象中才能使用
  components: {},
  data() {
    return {
      activeIndex: "1",
      activeIndex2: "1",
      inputTxt: "",
    };
  },
  methods: {
    handleSelect(key, keyPath) {
      console.log(key, keyPath);
    },
  },
};
</script>
<style lang="less" scoped>
.nav-menu {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  height: 46px;
  border: 1px solid rgba(0, 0, 0, 0.2);
  .nav-txt {
    height: 46px;
    line-height: 46px;
    text-align: center;
    font-size: 18px;
    padding-left: 20px;
  }
  .nav-content {
    display: flex;
    flex-direction: row;
    justify-content: flex-end;
    .nav-input {
      height: 46px;
      line-height: 46px;
      text-align: center;
      ::v-deep .el-input__inner {
        border-radius: 20px;
      }
    }
    ::v-deep .el-menu-demo {
      height: 46px;
      .el-menu-item {
        height: 46px;
        line-height: 46px;
        color: #000;
      }
      .el-submenu__title {
        height: 46px;
        line-height: 46px;
        color: #000;
      }
    }
  }
}
</style>
